﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using secondhand.L2busslogic;
using secondhand.L1database;
using secondhand.L3object;

namespace secondhand.L4view.yonghu
{
    public partial class yonghu_alert_email : System.Web.UI.Page
    {
        public static userOB aa = new userOB();
        protected void Page_Load(object sender, EventArgs e)
        {
            aa = userBL.Getwordsingle(Session["login"].ToString());
            Label3.Text = aa.user_mail;

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text.Length == 0)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('所要修改的用户名不能为空 ');</script>");
                return;
            }
            userOB mydd = new userOB();
            mydd = userBL.Getwordsingle(Session["login"].ToString());
            mydd.user_mail = TextBox1.Text;
            if (!userBL.Savemark(mydd))
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('修改不成功 ');</script>");
                return;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('您已成功修改，请重新登录!');{location.href='yonghu_login.aspx'}</script>");
                return;
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/L4View/yonghu/yonghu_person_info.aspx");
        }
    }
}